package com.jucai.pppeiyouclient.adapter;

import android.content.Context;

import com.jucai.pppeiyouclient.R;
import com.jucai.pppeiyouclient.base.CommonRecyclerViewAdapter;
import com.jucai.pppeiyouclient.bean.CouponBean;

import java.util.List;

/**
 * Created by Kuky on 2017-04-22.
 */

public class CouponAdapter extends CommonRecyclerViewAdapter<CouponBean> {

    public CouponAdapter(Context context, List<CouponBean> data) {
        super(context, data);
    }

    @Override
    public void bindHolder(CommonHolder holder, CouponBean couponBean) {
        holder.setText(R.id.coupon_name, couponBean.getCouponName());
        holder.setText(R.id.coupon_valid, "有效期至" + couponBean.getValidTime());
        holder.setText(R.id.coupon_value, couponBean.getCouponValue());
        holder.setText(R.id.coupon_content, couponBean.getCouponContent());
    }

    @Override
    protected int getItemType(int position) {
        return 0;
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_coupon_layout;
    }
}
